<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1"><title id="az137232">ALTER TEXT SEARCH CONFIGURATION</title><body><p id="sql_command_desc">Changes the definition of a text search configuration.</p><section id="section2"><title>Synopsis</title>
      <codeblock id="sql_command_synopsis">ALTER TEXT SEARCH CONFIGURATION <varname>name</varname>
    ALTER MAPPING FOR <varname>token_type</varname> [, ... ] WITH <varname>dictionary_name</varname> [, ... ]
ALTER TEXT SEARCH CONFIGURATION <varname>name</varname>
    ALTER MAPPING REPLACE <varname>old_dictionary</varname> WITH <varname>new_dictionary</varname>
ALTER TEXT SEARCH CONFIGURATION <varname>name</varname>
    ALTER MAPPING FOR <varname>token_type</varname> [, ... ] REPLACE <varname>old_dictionary</varname> WITH <varname>new_dictionary</varname>
ALTER TEXT SEARCH CONFIGURATION <varname>name</varname>
    DROP MAPPING [ IF EXISTS ] FOR <varname>token_type</varname> [, ... ]
ALTER TEXT SEARCH CONFIGURATION <varname>name</varname> RENAME TO <varname>new_name</varname>
ALTER TEXT SEARCH CONFIGURATION <varname>name</varname> OWNER TO <varname>new_owner</varname>
ALTER TEXT SEARCH CONFIGURATION <varname>name</varname> SET SCHEMA <varname>new_schema</varname></codeblock></section><section id="section3"><title>Description</title>
      <p><codeph>ALTER TEXT SEARCH CONFIGURATION</codeph> changes the definition of a text search
        configuration. You can modify its mappings from token types to dictionaries, or change the
        configuration's name or owner.</p>
      <p>You must be the owner of the configuration to use <codeph>ALTER TEXT SEARCH
          CONFIGURATION</codeph>.</p></section><section id="section4"><title>Parameters</title>
      <parml>
        <plentry>
          <pt><codeph><varname>name</varname></codeph></pt>
          <pd>The name (optionally schema-qualified) of an existing text search configuration.</pd>
        </plentry>
        <plentry>
          <pt><codeph><varname>token_type</varname></codeph></pt>
          <pd>The name of a token type that is emitted by the configuration's parser.</pd>
        </plentry>
        <plentry>
          <pt><codeph><varname>dictionary_name</varname></codeph></pt>
          <pd>The name of a text search dictionary to be consulted for the specified token type(s).
            If multiple dictionaries are listed, they are consulted in the specified order.</pd>
        </plentry>
        <plentry>
          <pt><codeph><varname>old_dictionary</varname></codeph></pt>
          <pd>The name of a text search dictionary to be replaced in the mapping.</pd>
        </plentry>
        <plentry>
          <pt><codeph><varname>new_dictionary</varname></codeph></pt>
          <pd>The name of a text search dictionary to be substituted for old_dictionary.</pd>
        </plentry>
        <plentry>
          <pt><codeph><varname>new_name</varname></codeph></pt>
          <pd>
            <p>The new name of the text search configuration.</p>
          </pd>
        </plentry>
        <plentry>
          <pt><varname>new_owner</varname></pt>
          <pd>
            <p>The new owner of the text search configuration.</p>
          </pd>
        </plentry>
        <plentry>
          <pt><codeph><varname>new_schema</varname></codeph></pt>
          <pd>
            <p>The new schema for the text search configuration.</p>
          </pd>
        </plentry>
      </parml>
            <p>The <codeph>ADD MAPPING FOR</codeph> form installs a list of dictionaries to be
        consulted for the specified token type(s); it is an error if there is already a mapping for
        any of the token types. The <codeph>ALTER MAPPING FOR</codeph> form does the same, but first
        removing any existing mapping for those token types. The <codeph>ALTER MAPPING
          REPLACE</codeph> forms substitute <varname>new_dictionary</varname> for
          <varname>old_dictionary</varname> anywhere the latter appears. This is done for only the
        specified token types when <codeph>FOR</codeph> appears, or for all mappings of the
        configuration when it doesn't. The <codeph>DROP MAPPING</codeph> form removes all
        dictionaries for the specified token type(s), causing tokens of those types to be ignored by
        the text search configuration. It is an error if there is no mapping for the token types,
        unless <codeph>IF EXISTS</codeph> appears.</p>
            
            
            
</section><section id="section5"><title>Examples</title>
      <p>The following example replaces the <codeph>english</codeph> dictionary with the
          <codeph>swedish</codeph> dictionary anywhere that <codeph>english</codeph> is used within
          <codeph>my_config</codeph>.</p>
      <codeblock>ALTER TEXT SEARCH CONFIGURATION my_config
  ALTER MAPPING REPLACE english WITH swedish;</codeblock></section><section id="section6"><title>Compatibility</title><p>There is no <codeph>ALTER TEXT SEARCH CONFIGURATION</codeph> statement in the SQL standard.</p></section><section id="section7"><title>See Also</title><p><codeph><xref href="./CREATE_TEXT_SEARCH_CONFIGURATION.xml#topic1" type="topic" format="dita"
          /></codeph>, <codeph><xref href="./DROP_TEXT_SEARCH_CONFIGURATION.xml#topic1" type="topic"
            format="dita"/></codeph></p></section></body></topic>
